<%@ page contentType="text/html;charset=UTF-8" isErrorPage="true" %>
<%@ page import="java.util.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>请选择组合的子产品</title>
</head>


<body>
<table width="100%" border="1" cellpadding="1" cellspacing="1" class="newfont03">
   				 <tr bgcolor="#EEEEEE">
                    	<td height="22" colspan="4" align="center" >&nbsp;请选择组合产品的子产品</td>
                  </tr>
   				  <% 
    				  ArrayList list=(ArrayList)request.getAttribute("divList");
    				  int count = list.size();
    				  int trNum = count/4;
    				  if(count%4!=0){
    				  	 trNum = trNum+1;
    				  }
					  for(int i=1;i<trNum+1;i++){
				  %>
				  <tr>
				  <%  
					  	for(int j =1+(i-1)*4;j<i*4+1;j++){
					  		if(j<=list.size()){
    				  			Object[] obj = (Object[])list.get(j-1);
   				  %>
   				 	<td align="left"><input type='checkbox' name='ok' value='<%=obj[0]%>'><%=obj[1]%></td> 	  
   				  <%}}%>
    			  </tr>
    			  <%} %>
   				 </tr>
   				 
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="newfont03">
		<tr>
   		 	<td colspan="4" align="center"><input type="button" value="确定" onclick="getCheckBoxValue()" /></td>
   		</tr>
</table>
</body>
</html>
<script language="javascript"> 
function getCheckBoxValue()
{
	var val="";
	var oks = document.getElementsByName('ok');
	for(j=0;j < oks.length;j++){
		if(oks[j].checked==true){
			if(val==""){
				val +=oks[j].value;
			}else{
				val +="|"+oks[j].value;
			}
		}
	}
	if(val==""){
		alert("请选择组合的子产品");
		return；
	}
    window.parent.document.getElementById('hidvalue').value=val;
    window.parent.TB_remove();         
}

function close(){
	window.parent.TB_remove();   
}
</script> 